home *** CD-ROM | disk | FTP | other *** search
- Path: news.bellglobal.com!news
- From: bogdanfl@aei.ca (Bogdan Florescu)
- Newsgroups: comp.lang.c++
- Subject: HELP with a simple C Structure
- Date: Sun, 31 Mar 1996 17:02:51 GMT
- Organization: Bell Global Solutions
- Message-ID: <4jm38u$j1a@news.bellglobal.com>
- NNTP-Posting-Host: diala07.aei.ca
- X-Newsreader: Forte Free Agent 1.0.82
-
- I need to do this, and I don't khow how.
-
- struct Employee
- {
- float salary;
- char department;
- }
-
- Employee Jim, Paul, Pat, Scott;
-
- void main(void)
- {
- Jim.salary=15;
- Paul.salary=14;
- Pat.salary=13;
- Scott.salary=12;
-
- Jim.department='a';
- Paul.department='b';
- Pat.department='c';
- Scott.department='b';
- ................................
- }
-
- I need to replace the dots with a program that tells me who else works
- in Paul's department and how much money he makes.
-
- I would like to have the structure variables named with the name of
- the employee, (instead of an array with the name of the employee as a
- member) so I can easily access their members. The structure can be
- modified, but I really need to be able to have expressions such as
- Jim.salary.
-
- Thank you,
- Bogdan Florescu
-
-
-